package com.qiang.test01;

import java.io.*;

public class Demo1101 {
    public static void main(String[] args) throws IOException {
        /*//创建file对象
        File f1 = new File("D:\\hh\\t.txt");

        //创建Stream流对象
        FileOutputStream fs = new FileOutputStream("D:\\hh\\t.txt");
        byte[] b = {97, 98, 99};
        fs.write(b);
*/
        long a = System.currentTimeMillis();

        //创建复制对象
        //FileOutputStream fs3 = new FileOutputStream("D:\\kk\\kk.avi");
        BufferedOutputStream fs3 = new BufferedOutputStream(new FileOutputStream("D:\\kk\\kk.avi"));

        //创建读取对象

        //FileInputStream fs2 = new FileInputStream("D:\\hh\\hh.avi");
        BufferedInputStream fs2 = new BufferedInputStream(new FileInputStream("D:\\hh\\hh.avi"));

        byte[] bb = new byte[1024];
        int read = fs2.read(bb);
        while (read != -1) {
            fs3.write(bb, 0, read);
            read = fs2.read(bb);
        }
        //fs.close();
        fs2.close();
        fs3.close();
        long aa = System.currentTimeMillis();
        System.out.println(aa - a);
    }
}
